.class public Lcom/estrongs/android/pop/app/filetransfer/n;
.super Ljava/lang/Object;
.source "ScanPortTask.java"

# interfaces
.implements Ljava/lang/Runnable;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/app/filetransfer/n$b;,
        Lcom/estrongs/android/pop/app/filetransfer/n$a;
    }
.end annotation


# static fields
.field private static h:I = 0x40

.field private static i:I = 0x100


# instance fields
.field private a:[B

.field private b:J

.field private c:Landroid/content/Context;

.field private d:Ljava/lang/Object;

.field private e:Lcom/estrongs/android/pop/app/filetransfer/n$b;

.field private f:Ljava/util/concurrent/ThreadPoolExecutor;

.field private g:Z


# direct methods
.method static constructor <clinit>()V
    .locals 0

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Lcom/estrongs/android/pop/app/filetransfer/n$b;)V
    .locals 8

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance v0, Ljava/lang/Object;

    invoke-direct {v0}, Ljava/lang/Object;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->d:Ljava/lang/Object;

    const/4 v0, 0x0

    .line 3
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->e:Lcom/estrongs/android/pop/app/filetransfer/n$b;

    .line 4
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    const/4 v0, 0x0

    .line 5
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->g:Z

    .line 6
    invoke-static {p1}, Lcom/estrongs/android/pop/app/filetransfer/n;->b(Landroid/content/Context;)[B

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    .line 7
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->c:Landroid/content/Context;

    .line 8
    iput-object p2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->e:Lcom/estrongs/android/pop/app/filetransfer/n$b;

    .line 9
    new-instance p1, Ljava/util/concurrent/ThreadPoolExecutor;

    sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;

    new-instance v7, Ljava/util/concurrent/LinkedBlockingDeque;

    invoke-direct {v7}, Ljava/util/concurrent/LinkedBlockingDeque;-><init>()V

    const/4 v2, 0x5

    const/16 v3, 0xa

    const-wide/16 v4, 0x1e

    move-object v1, p1

    invoke-direct/range {v1 .. v7}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V

    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/filetransfer/n;)Ljava/lang/Object;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->d:Ljava/lang/Object;

    return-object p0
.end method

.method public static a(Landroid/content/Context;)Ljava/lang/String;
    .locals 5

    .line 6
    invoke-static {p0}, Lcom/estrongs/android/pop/app/filetransfer/n;->b(Landroid/content/Context;)[B

    move-result-object p0

    if-eqz p0, :cond_4

    const/4 v0, 0x0

    .line 7
    aget-byte v1, p0, v0

    if-ltz v1, :cond_0

    aget-byte v0, p0, v0

    goto :goto_0

    :cond_0
    sget v1, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    aget-byte v0, p0, v0

    add-int/2addr v0, v1

    :goto_0
    const/4 v1, 0x1

    .line 8
    aget-byte v2, p0, v1

    if-ltz v2, :cond_1

    aget-byte v1, p0, v1

    goto :goto_1

    :cond_1
    sget v2, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    aget-byte v1, p0, v1

    add-int/2addr v1, v2

    :goto_1
    const/4 v2, 0x2

    .line 9
    aget-byte v3, p0, v2

    if-ltz v3, :cond_2

    aget-byte v2, p0, v2

    goto :goto_2

    :cond_2
    sget v3, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    aget-byte v2, p0, v2

    add-int/2addr v2, v3

    :goto_2
    const/4 v3, 0x3

    .line 10
    aget-byte v4, p0, v3

    if-ltz v4, :cond_3

    aget-byte p0, p0, v3

    goto :goto_3

    :cond_3
    sget v4, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    aget-byte p0, p0, v3

    add-int/2addr p0, v4

    .line 11
    :goto_3
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, "."

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v3, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    .line 12
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p0

    goto :goto_4

    :cond_4
    const/4 p0, 0x0

    :goto_4
    return-object p0
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/filetransfer/n;)Landroid/content/Context;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->c:Landroid/content/Context;

    return-object p0
.end method

.method public static b(Landroid/content/Context;)[B
    .locals 5
    .annotation build Landroid/annotation/SuppressLint;
        value = {
            "NewApi"
        }
    .end annotation

    const/4 v0, 0x0

    if-nez p0, :cond_0

    return-object v0

    .line 2
    :cond_0
    sget v1, Landroid/os/Build$VERSION;->SDK_INT:I

    const-string v2, "wifi"

    .line 3
    invoke-virtual {p0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Landroid/net/wifi/WifiManager;

    if-eqz p0, :cond_1

    .line 4
    invoke-virtual {p0}, Landroid/net/wifi/WifiManager;->getConnectionInfo()Landroid/net/wifi/WifiInfo;

    move-result-object p0

    if-eqz p0, :cond_1

    .line 5
    invoke-virtual {p0}, Landroid/net/wifi/WifiInfo;->getIpAddress()I

    move-result p0

    if-eqz p0, :cond_1

    const/4 v0, 0x4

    new-array v0, v0, [B

    const/4 v1, 0x3

    shr-int/lit8 v2, p0, 0x18

    int-to-byte v2, v2

    aput-byte v2, v0, v1

    const/4 v1, 0x2

    shr-int/lit8 v2, p0, 0x10

    int-to-byte v2, v2

    aput-byte v2, v0, v1

    const/4 v1, 0x1

    shr-int/lit8 v2, p0, 0x8

    int-to-byte v2, v2

    aput-byte v2, v0, v1

    const/4 v1, 0x0

    shr-int/2addr p0, v1

    int-to-byte p0, p0

    aput-byte p0, v0, v1

    return-object v0

    .line 6
    :cond_1
    :try_start_0
    invoke-static {}, Ljava/net/NetworkInterface;->getNetworkInterfaces()Ljava/util/Enumeration;

    move-result-object p0

    :cond_2
    :goto_0
    invoke-interface {p0}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v2

    if-eqz v2, :cond_6

    .line 7
    invoke-interface {p0}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/net/NetworkInterface;

    .line 8
    invoke-virtual {v2}, Ljava/net/NetworkInterface;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;

    move-result-object v3

    const-string v4, "lo"

    .line 9
    invoke-virtual {v3, v4}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_2

    const-string v4, "RMNET"

    .line 10
    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_2

    const-string v4, "USB"

    .line 11
    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v4

    if-nez v4, :cond_2

    const-string v4, "PPP"

    .line 12
    invoke-virtual {v3, v4}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_3

    goto :goto_0

    :cond_3
    const/16 v3, 0x9

    if-lt v1, v3, :cond_4

    .line 13
    invoke-virtual {v2}, Ljava/net/NetworkInterface;->getHardwareAddress()[B

    move-result-object v3

    if-eqz v3, :cond_2

    .line 14
    array-length v3, v3

    const/4 v4, 0x6

    if-ne v3, v4, :cond_2

    invoke-virtual {v2}, Ljava/net/NetworkInterface;->isUp()Z

    move-result v3

    if-nez v3, :cond_4

    goto :goto_0

    .line 15
    :cond_4
    invoke-virtual {v2}, Ljava/net/NetworkInterface;->getInetAddresses()Ljava/util/Enumeration;

    move-result-object v2

    :cond_5
    invoke-interface {v2}, Ljava/util/Enumeration;->hasMoreElements()Z

    move-result v3

    if-eqz v3, :cond_2

    .line 16
    invoke-interface {v2}, Ljava/util/Enumeration;->nextElement()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/net/InetAddress;

    .line 17
    invoke-virtual {v3}, Ljava/net/InetAddress;->isLoopbackAddress()Z

    move-result v4

    if-nez v4, :cond_5

    instance-of v4, v3, Ljava/net/Inet6Address;

    if-nez v4, :cond_5

    .line 18
    invoke-virtual {v3}, Ljava/net/InetAddress;->getAddress()[B

    move-result-object p0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-object p0

    :catch_0
    :cond_6
    return-object v0
.end method

.method static synthetic c(Lcom/estrongs/android/pop/app/filetransfer/n;)Lcom/estrongs/android/pop/app/filetransfer/n$b;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->e:Lcom/estrongs/android/pop/app/filetransfer/n$b;

    return-object p0
.end method

.method static synthetic d(Lcom/estrongs/android/pop/app/filetransfer/n;)J
    .locals 4

    .line 1
    iget-wide v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->b:J

    const-wide/16 v2, 0x1

    add-long/2addr v2, v0

    iput-wide v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->b:J

    return-wide v0
.end method


# virtual methods
.method public a()V
    .locals 1

    const/4 v0, 0x1

    .line 2
    iput-boolean v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->g:Z

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    invoke-virtual {v0}, Ljava/util/concurrent/ThreadPoolExecutor;->shutdownNow()Ljava/util/List;

    const/4 v0, 0x0

    .line 4
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    .line 5
    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->c:Landroid/content/Context;

    return-void
.end method

.method public b()V
    .locals 1

    .line 19
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    invoke-virtual {v0, p0}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 20
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method

.method public run()V
    .locals 10

    const/16 v0, 0xa

    .line 1
    invoke-static {v0}, Landroid/os/Process;->setThreadPriority(I)V

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    if-nez v0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    const/4 v1, 0x0

    .line 3
    :cond_1
    :try_start_0
    iget-boolean v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->g:Z

    if-nez v2, :cond_9

    .line 4
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v2, v2, v0

    if-ltz v2, :cond_2

    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v2, v2, v0

    goto :goto_0

    :cond_2
    sget v2, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v3, v3, v0

    add-int/2addr v2, v3

    .line 5
    :goto_0
    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    const/4 v4, 0x1

    aget-byte v3, v3, v4

    if-ltz v3, :cond_3

    iget-object v3, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v3, v3, v4

    goto :goto_1

    :cond_3
    sget v3, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    iget-object v5, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v4, v5, v4

    add-int/2addr v3, v4

    .line 6
    :goto_1
    iget-object v4, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    const/4 v5, 0x2

    aget-byte v4, v4, v5

    if-ltz v4, :cond_4

    iget-object v4, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v4, v4, v5

    goto :goto_2

    :cond_4
    sget v4, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    iget-object v6, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->a:[B

    aget-byte v5, v6, v5

    add-int/2addr v4, v5

    .line 7
    :goto_2
    iget-object v5, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->d:Ljava/lang/Object;

    monitor-enter v5
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    const-wide/16 v6, 0x0

    .line 8
    :try_start_1
    iput-wide v6, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->b:J

    .line 9
    monitor-exit v5
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    const/4 v5, 0x0

    .line 10
    :goto_3
    :try_start_2
    sget v6, Lcom/estrongs/android/pop/app/filetransfer/n;->h:I

    if-ge v5, v6, :cond_6

    .line 11
    sget v6, Lcom/estrongs/android/pop/app/filetransfer/n;->h:I

    mul-int v6, v6, v1

    add-int/2addr v6, v5

    .line 12
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    const-string v8, ""

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, "."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, "."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, "."

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7, v6}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    .line 13
    iget-object v8, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    if-eqz v8, :cond_5

    iget-boolean v8, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->g:Z

    if-nez v8, :cond_5

    .line 14
    iget-object v8, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->f:Ljava/util/concurrent/ThreadPoolExecutor;

    new-instance v9, Lcom/estrongs/android/pop/app/filetransfer/n$a;

    invoke-direct {v9, p0, v7, v6}, Lcom/estrongs/android/pop/app/filetransfer/n$a;-><init>(Lcom/estrongs/android/pop/app/filetransfer/n;Ljava/lang/String;I)V

    invoke-virtual {v8, v9}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V

    :cond_5
    add-int/lit8 v5, v5, 0x1

    goto :goto_3

    .line 15
    :catch_0
    :cond_6
    :goto_4
    iget-boolean v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->g:Z

    if-nez v2, :cond_8

    .line 16
    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->d:Ljava/lang/Object;

    monitor-enter v2
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    .line 17
    :try_start_3
    iget-wide v3, p0, Lcom/estrongs/android/pop/app/filetransfer/n;->b:J

    sget v5, Lcom/estrongs/android/pop/app/filetransfer/n;->h:I

    int-to-long v5, v5

    cmp-long v7, v3, v5

    if-nez v7, :cond_7

    .line 18
    monitor-exit v2

    goto :goto_5

    .line 19
    :cond_7
    monitor-exit v2
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    const-wide/16 v2, 0x1f4

    .line 20
    :try_start_4
    invoke-static {v2, v3}, Ljava/lang/Thread;->sleep(J)V
    :try_end_4
    .catch Ljava/lang/InterruptedException; {:try_start_4 .. :try_end_4} :catch_0
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1

    goto :goto_4

    :catchall_0
    move-exception v0

    .line 21
    :try_start_5
    monitor-exit v2
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_0

    :try_start_6
    throw v0

    :cond_8
    :goto_5
    add-int/lit8 v1, v1, 0x1

    .line 22
    sget v2, Lcom/estrongs/android/pop/app/filetransfer/n;->i:I

    sget v3, Lcom/estrongs/android/pop/app/filetransfer/n;->h:I

    div-int/2addr v2, v3
    :try_end_6
    .catch Ljava/lang/Exception; {:try_start_6 .. :try_end_6} :catch_1

    if-lt v1, v2, :cond_1

    goto :goto_6

    :catchall_1
    move-exception v0

    .line 23
    :try_start_7
    monitor-exit v5
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_1

    :try_start_8
    throw v0
    :try_end_8
    .catch Ljava/lang/Exception; {:try_start_8 .. :try_end_8} :catch_1

    :catch_1
    move-exception v0

    .line 24
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :cond_9
    :goto_6
    return-void
.end method
